package chap4.Task;
import java.util.Scanner;
public class Task12 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int i = 1000;
        int a, b, c, d;
        System.out.println("所有的4位水仙花数为");
        while (i <= 9999) {
            a = i % 10;
            b = i % 100 / 10;
            c = i % 1000 / 100;
            d = i / 1000;
            if (i == a * a * a * a + b * b * b * b + c * c * c * c + d * d * d * d) {
                System.out.println(i);
            }
            i++;
        }
        ;
    }

}
